package com.shanyue.redwine.http;

import com.shanyue.redwine.utils.Constants;

/**
 * Created by Huang on 2016/7/26.
 */
public class ApiResponse<T> {

    public int type;
    public String msg;
    public String version;
    public String encry;
    public String timestamp;
    public T result;


    public boolean success() {
        //        if (code == Constants.RESULT_TOKEN_TIMEOUT) {//token过期
        //            RxBus.getDefault().post(RxBus.RX_TOKEN_TIMEOUT, -1);
        //        }
        return type == Constants.RESULT_OK;
    }

    @Override
    public String toString() {
        return "ApiResponse{" + "code=" + type + ", msg='" + msg + '\'' + ", version='" + version + '\'' + ", " +
                "encry='" + encry + '\'' + ", timestamp='" + timestamp + '\'' + ", " + "data=" + result + '}';
    }
}
